private ["_array","_item","_index", "_found"];

_item = _this select 0;
_array = _this select 1;
_found = FALSE;
_index = 0;

while { !(_found) AND _index < count _array} do
{
	if (_item == (_array select _index)) then {_found = TRUE} else {_index = _index + 1};
};

if (!(_found)) then {_index = -1};

_index